<?php
/**
 * @package scuttle
 * @file /admin/forms/WatchedAdminEditForm.class.php
 **/

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_ROOT_PATH.'/core/XCube_ActionForm.class.php';
require_once XOOPS_MODULE_PATH.'/legacy/class/Legacy_Validator.class.php';

class Scuttle_WatchedAdminEditForm extends XCube_ActionForm
{
	function Scuttle_WatchedEditForm()
	{
		parent::XCube_ActionForm();
	}

	function getTokenName()
	{
		return 'module.scuttle.WatchedAdminEditForm.TOKEN.' . $this->get('wId');

	}
	function prepare()
	{
		$this->mFormProperties['wId'] =& new XCube_IntProperty('wId');
		$this->mFormProperties['uId'] =& new XCube_IntProperty('uId');
		$this->mFormProperties['watched'] =& new XCube_IntProperty('watched');

		$this->mFieldProperties['wId'] =& new XCube_FieldProperty($this);
		$this->mFieldProperties['wId']->setDependsByArray(array('required'));
		$this->mFieldProperties['wId']->addMessage('required', _MD_SC_ERROR_REQUIRED, _MD_SC_WATCHED_WID);
	}

	function load(&$obj)
	{
		$this->set('wId' , $obj->get('wId'));
		$this->set('uId' , $obj->get('uId'));
		$this->set('watched' , $obj->get('watched'));
	}

	function update(&$obj)
	{
		$obj->set('wId' , $this->get('wId'));
		$obj->set('uId' , $this->get('uId'));
		$obj->set('watched' , $this->get('watched'));
	}
}
?>